﻿// PublishTask.cs
using System.Security.Principal;

[DisplayName("发布管理模块")]
public class PublishTask : EntityBase
{
    [Required]
    [Key]
    [MaxLength(50)]
    [DisplayName("发布任务ID")]
    public string TaskId { get; set; }

    [Required]
    [MaxLength(50)]
    [DisplayName("视频ID")]
    public string VideoId { get; set; }

    [Required]
    [DisplayName("帐号")]
    public string AccountIds { get; set; }


    [DisplayName("计划发布时间")]
    public DateTime? ScheduleTime { get; set; }


    [DisplayName("发布配置")]
    public string PublishOptions { get; set; }

    [Required]

    [DisplayName("发布状态")]
    public PublishStatus Status { get; set; } = PublishStatus.Pending;


    [DisplayName("发布结果")]
    public string Results { get; set; }

    [Required]
    [DisplayName("发布时间")]
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    [DisplayName("发布开始时间")]
    public DateTime? StartedAt { get; set; }
    [DisplayName("发布完成时间")]
    public DateTime? CompletedAt { get; set; }

    public virtual Video Video { get; set; }
}

public enum PublishStatus
{
    Pending = 0,
    Processing = 1,
    Completed = 2,
    PartiallyCompleted = 3,
    Failed = 4,
    Canceled = 5
}